// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 给角色分配(修改)权限 POST /admin/role/assignPermissionToRole */
export async function assignPermissionToRoleUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.assignPermissionToRoleUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/role/assignPermissionToRole', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 删除角色信息 DELETE /admin/role/deleteRoleInfo */
export async function deleteRoleInfoUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteRoleInfoUsingDELETEParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResult>('/admin/role/deleteRoleInfo', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 添加角色信息,权限只需要permissionID POST /admin/role/insertRoleInfo */
export async function insertRoleInfoUsingPOST(body: API.Role, options?: { [key: string]: any }) {
  return request<API.BaseResult>('/admin/role/insertRoleInfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询角色信息 GET /admin/role/pageQueryRole */
export async function pageQueryRoleUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pageQueryRoleUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResultPageRole_>('/admin/role/pageQueryRole', {
    method: 'GET',
    params: {
      // currentPage has a default value: 1
      currentPage: '1',
      // pageSize has a default value: 10
      pageSize: '10',
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询所有的角色信息 GET /admin/role/queryAllRolesInfo */
export async function queryAllRolesInfoUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResultListRole_>('/admin/role/queryAllRolesInfo', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 根据ID查询角色 GET /admin/role/queryById/${param0} */
export async function queryRoleUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryRoleUsingGETParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResultRolePermissions_>(`/admin/role/queryById/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 修改角色信息 POST /admin/role/updateRoleInfo */
export async function updateRoleInfoUsingPOST(body: API.Role, options?: { [key: string]: any }) {
  return request<API.BaseResult>('/admin/role/updateRoleInfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
